package com.googlecode.tinyjava.symboltable;

public class NamedItem {

	public NamedItem next;

	public String name;
	
	public NamedItem(String name) {
		super();
		this.name = name;
	}

	void indent(int indent) {
		while(indent > 0) {
			System.out.print('\t');
			indent--;
		}
	}

	public void print(int indent) {
		indent(indent);
		System.out.println(this);
	}

	public void printError() {
		System.out.println(this + " already exists.");
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		return name;
	}
}
